﻿using Application.Users.Models;
using Application.Users.Queries.GetUser;
using Ardalis.Specification;
using Domain.Entities;
using Domain.ValueObjects;

namespace Application.Users.Interfaces
{
    public interface IUserReadRepository
    {

        /// <summary>
        /// 通过手机号登录 todo待改名
        /// </summary>
        /// <param name="phoneNumber"></param>
        /// <param name="passwordHash"></param>
        /// <param name="cancellationToken"></param>
        /// <returns></returns>
        Task<UserItem?> AuthenticateByPhoneNumberAsync(PhoneNumber phoneNumber,string passwordHash, CancellationToken cancellationToken = default);

        /// <summary>
        /// 规约模式获取用户信息列表
        /// </summary>
        /// <param name="name"></param>
        /// <param name="cancellationToken"></param>
        /// <returns></returns>
        Task<IReadOnlyCollection<GetUserModel>> GetUsersAsync(ISpecification<User> spec, CancellationToken cancellationToken = default);
    }
}
